package com.think.excel;

import org.springframework.core.env.EnumerablePropertySource;

import java.util.Map;

public class ExcelPropertySource extends EnumerablePropertySource<Map<String, Object>> {

    public ExcelPropertySource(String name, Map<String, Object> source) {
        super(name, source);
    }

    @Override
    public String[] getPropertyNames() {
        return source.keySet().toArray(new String[0]);
    }

    @Override
    public Object getProperty(String name) {
        return source.get(name);
    }
}
